package com.webank.wedatasphere.qualitis.question.service.impl;

import com.webank.wedatasphere.qualitis.dao.UserDao;
import com.webank.wedatasphere.qualitis.question.service.QuestionUserService;
import com.webank.wedatasphere.qualitis.question.service.dto.UserDto;
import com.webank.wedatasphere.qualitis.question.service.transform.OrderTransform;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class QuestionUserServiceImpl implements QuestionUserService {

    @Resource
    private UserDao userDao;

    @Override
    public List<UserDto> getAllUsers() {
        return userDao.findAllUser().stream().map(OrderTransform::toUserDto).collect(Collectors.toList());
    }
}
